﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AggregateRoot.Console
{
    public class ProductRepository
    {
        DataContext _db;
        private DataContext db;

        public ProductRepository()
        {
            _db = new DataContext();
        }

        public ProductRepository(DataContext db)
        {
            _db = db;
        }

        public Product GetByProductId(int productId)
        {
            return _db.Products.SingleOrDefault(p => p.ProductID == productId);
        }
    }
}
